hide inifile_t from users (#1085)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Tue, 25 Apr 2023 20:30:42 +0000 (14:30 -0600)
committerGitHub <noreply@github.com>
Tue, 25 Apr 2023 20:30:42 +0000 (14:30 -0600)
* hide inifile_t from users.

* explicitly make vars have internal linkage

although since c++11 all vars declared in unnamed namespaces will
anyway.

inifile.cc
inifile.h

index cb0279071c94483c64097f030a8676ff9ee91473..3daa49c8d2ada815d2338789dd90555c49d64aa5 100644 (file)
 
 #define MYNAME "inifile"
 
+struct inifile_t {
+  QHash<QString, InifileSection> sections;
+  QString source;
+};
+
 class InifileSection
 {
 public:
@@ -46,8 +51,8 @@ public:
 
 /* internal procedures */
 
-#define GPSBABEL_INIFILE "gpsbabel.ini"
-#define GPSBABEL_SUBDIR ".gpsbabel"
+static constexpr char GPSBABEL_INIFILE[] = "gpsbabel.ini";
+static constexpr char GPSBABEL_SUBDIR[] = ".gpsbabel";
 
 
 static QString
index ef42c08760ad2e9f89e968df2c07d961dff63276..4444ee1847571edf33724ccc5154eb0e6c847750 100644 (file)
--- a/inifile.h
+++ b/inifile.h
 #include <QString>         // for QString
 
 class InifileSection;
-struct inifile_t {
-  QHash<QString, InifileSection> sections;
-  QString source;
-};
+struct inifile_t; // forward declare, opaque to users.
 
 /*
        inifile_init: